      SUBROUTINE SETUP
      RETURN
      END
C   HS65
      SUBROUTINE EF(X,FX)
      INCLUDE 'FUCO.INC'
      DOUBLE PRECISION X(NX),FX
      ICF=ICF+1
      FX= (X(1)-X(2))**2+(X(1)+X(2)-10.D0)**2/9.D0+(X(3)-5.D0)**2
      RETURN
      END
      SUBROUTINE EGRADF(X,GRADF)
      INCLUDE 'FUCO.INC'
      DOUBLE PRECISION X(NX),GRADF(NX),X1,X2,X3
      ICGF=ICGF+1
      X1=X(1)
      X2=X(2)
      X3=X(3)
      GRADF(1)= 2. D0*(X1-X2+(X1+X2-10.D0)/9.D0)
      GRADF(2)= 2. D0*(X2-X1+(X1+X2-10.D0)/9.D0)
      GRADF(3)= 2. D0*(X3-5.D0)
      RETURN
      END
      SUBROUTINE EH(I,X,HXI)
      INCLUDE 'FUCO.INC'
      INTEGER I
      DOUBLE PRECISION X(NX),HXI
      CRES(I)=CRES(I)+1
      RETURN
      END
      SUBROUTINE EGRADH(I,X,GRADHI)
      INCLUDE 'FUCO.INC'
      INTEGER I
      DOUBLE PRECISION X(NX),GRADHI(NX)
      CGRES(I)=CGRES(I)+1
      RETURN
      END
      SUBROUTINE EG(I,X,GXI)
      INCLUDE 'FUCO.INC'
      INTEGER I
      DOUBLE PRECISION X(NX),UG(3),GXI
      SAVE UG
      DATA UG/2*4.5D0,5.D0/
      IF ( GUNIT(1,I+NH) .EQ. -1 )CRES(I+NH)=CRES(I+NH)+1      
      IF(I.GT.6)      GOTO 200
      IF(I.GT.3)      GOTO 100
      GXI=UG(I)+X(I)
      RETURN
  100 CONTINUE
      GXI=UG(I-3)-X(I-3)
      RETURN
  200 CONTINUE
      GXI=48.D0-(X(1)**2+X(2)**2+X(3)**2)
      RETURN
      END
      SUBROUTINE EGRADG(I,X,GRADGI)
      INCLUDE 'FUCO.INC'
      INTEGER I,J
      DOUBLE PRECISION X(NX) ,GRADGI(NX)
      IF ( GUNIT(1,I+NH) .EQ. 1 )RETURN
      CGRES(I+NH)=CGRES(I+NH)+1
       IF(I.GT.6)     GOTO 200
       IF(I.GT.3)     GOTO 100
       DO      50      J=1,3
       GRADGI(J)=0.D0
   50  CONTINUE
       GRADGI(I)=1.D0
       RETURN
  100  CONTINUE
       DO     150      J=1,3
       GRADGI(J)=0.D0
  150  CONTINUE
       GRADGI(I-3)=-1.D0
       RETURN
  200  CONTINUE
       DO     250      J=1,3
       GRADGI(J)=-2.D0*X(J)
  250  CONTINUE
      RETURN
      END
      BLOCK DATA
      INCLUDE 'BLOCO.INC'
      INTEGER I,J
      DATA NAME/'HS65'/
      DATA (X(I),I=1,3)/-5.D0,5.D0,0.D0/
      DATA N/3/ , NH/0/ , NG/7/
      DATA DEL0/1.00D0/ ,TAU0/1.00D0/ ,TAU/.1D0/
      DATA ((GUNIT(I,J),I=1,3),J=0,7)/-1,0,0,1,1,1,1,2,1,1,3,1,
     F            1,1,-1,1,2,-1,1,3,-1,-1,0,0/
      END
